Fix empty batch queue routing to respect child_job_options#18
Open
bmulholland wants to merge 1 commit intoOpsLevel:masterfrom
Open
Fix empty batch queue routing to respect child_job_options#18bmulholland wants to merge 1 commit intoOpsLevel:masterfrom
bmulholland wants to merge 1 commit intoOpsLevel:masterfrom
Conversation
When a Simplekiq orchestration encounters an empty batch (e.g., when guard clauses skip all child jobs in a step), Sidekiq Pro automatically schedules a Sidekiq::Batch::Empty job to ensure batch callbacks fire. However, this Empty job was being scheduled to the default queue instead of respecting the child_job_options queue configuration. This occurred because Sidekiq Pro uses the batch.callback_queue attribute to determine the queue for Empty jobs, and Simplekiq never set this value. This commit fixes the issue by: - Exposing child_job_options as a reader on Orchestration - Setting callback_queue on both orchestration and step batches when a queue is specified in child_job_options - Passing child_job_options through the callback chain so it's available in multi-step workflows Empty jobs will now respect the configured queue, maintaining queue isolation for orchestrations that use child_job_options. Orchestrations without child_job_options continue to use the default queue as before. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a Simplekiq orchestration encounters an empty batch (e.g., when guard clauses skip all child jobs in a step), Sidekiq Pro automatically schedules a Sidekiq::Batch::Empty job to ensure batch callbacks fire. However, this Empty job was being scheduled to the default queue instead of respecting the child_job_options queue configuration.
This occurred because Sidekiq Pro uses the batch.callback_queue attribute to determine the queue for Empty jobs, and Simplekiq never set this value.
This commit fixes the issue by:
Empty jobs will now respect the configured queue, maintaining queue isolation for orchestrations that use child_job_options. Orchestrations without child_job_options continue to use the default queue as before.